<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=Utf-8">
		<script type="text/javascript" src="jquery-1.11.2.min.js"></script>
		<link rel="stylesheet" href="./js/thirdPart/bootstrap/css/bootstrap.css" />
		<script type="text/javascript" src="xlsx.core.min.js"></script>
		<script src="./js/thirdPart/jquery/jquery.min.js"></script>
		<script src="./js/thirdPart/bootstrap/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="./js/dll.bundle.js"></script>
		<link href="./css/style.css" rel="stylesheet">
		<link rel="stylesheet" type="text/css" href="insertDate.css">
		<script type="text/javascript" src="./js/axios.min.js"></script>
		<script type="text/javascript" src="./js/home.bundle.js"></script>
	</head>
	<title></title>
	</head>
	<body>
		<div class="big">
			<div class="jdxx" style="margin: 0;">
				<div class="wrapper">
					<div class="btn-group btn-group-vertical fn-toolbar">
						<button class="btn btn-default" id="J_AddLink" type="button"><em
								class="icon-align-right"></em>添加连线</button>
						<button class="btn btn-default" id="J_DelLink" type="button"><em
								class="icon-align-justify"></em>删除连线</button>
						<button class="btn btn-default" id="J_ExportExcel" type="button"><em
								class="icon-align-justify"></em>导出Excel</button>
						<button class="btn btn-default" id="J_stoporigin" type="button"><em
								class="icon-align-justify"></em>停止模拟力</button>
						<button class="btn btn-default" id="J_resumerigin" type="button"><em
								class="icon-align-justify"></em>重启模拟力</button>
						<button class="btn btn-default" id="J_clecckrigin" type="button"><em
								class="icon-align-justify"></em>取消所有选中节点</button>
						<button class="btn btn-default" id="J_ExportPng" type="button"><em
								class="icon-align-justify"></em>导出图片</button>
						<button onclick="test()">测试</button>
					</div>
					<div class="graph-area">
					</div>
				</div>
	</body>
	</div>
	</div>
	</body>
	<script>
		function test() {}
		var zzexcel;

		function sendfile(obj) {
			if (!obj.files) {
				return;
			}
			var f = obj.files[0];
			var reader = new FileReader();
			reader.readAsBinaryString(f);
			reader.onload = function(e) {
				var data = e.target.result;
				zzexcel = XLSX.read(data, {
					type: 'binary'
				});
				for (var i = 0; i < zzexcel.SheetNames.length; i++) {
					var jsonData = JSON.stringify(XLSX.utils.sheet_to_json(zzexcel.Sheets[zzexcel.SheetNames[i]]));
					jsonData = jsonData.replace(/nodeId/g, "id");
					var jsonData_1 = jsonData.replace(/nodeName/g, "group");
					var jsonData_2 = jsonData_1.replace(/parentNodeId/g, "source");
					jsonData_2 = jsonData_2.replace(/id/g, "target");
					jsonData_2 = '[' + jsonData_2.substring(jsonData_2.indexOf('}') + 2);
					jsonData = $.parseJSON(jsonData_1);
					var arr = [];
					for (var i = 0; i < jsonData.length; i++) {
						if (i == 0) arr.push(jsonData[i]);
						b = false;
						if (arr.length > 0 && i > 0) {
							for (var j = 0; j < arr.length; j++) {
								if (arr[j].id == jsonData[i].id) {
									b = true;
								}
							}
							if (!b) {
								arr.push(jsonData[i]);
							}
						}
					}
					jsonData = JSON.stringify(arr);
					var mockData =
						'{"result":{"nodes":' + jsonData + ',"links":' + jsonData_2 + '}}'
					sessionStorage.setItem("token", mockData);
				}
			}
		}
	</script>
</html>
